/**
 * ANNCSR (2010-2011)
 */
package net.abbp.mtr;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import net.abbp.mtr.control.DateSelect;
import net.abbp.mtr.control.GraphMonitor;
import net.abbp.mtr.event.IDataArriveListener;
import net.abbp.mtr.i18n.I18N;


/**
 * 数据采集
 * 
 * @version 1.0 2010-12-18
 * @author lexloo(lexloo@gmail.com)
 * @since MTR 1.0
 */
public class DaqPane extends JPanel {
	private GraphMonitor monitorPane;

	public DaqPane() {
		this.initComponents();
	}

	/**
	 * 初始化
	 */
	private void initComponents() {
		this.setLayout(new BorderLayout());
		this.monitorPane = new GraphMonitor();
		this.add(this.monitorPane, BorderLayout.CENTER);

		//this.add(new DatePane(), BorderLayout.SOUTH);
	}

	/**
	 * 获取数据采集监听器
	 * 
	 * @return
	 */
	public IDataArriveListener getDataArriveListener() {
		return monitorPane;
	}

	private class DatePane extends JPanel {
		/**
		 * UID
		 */
		private static final long serialVersionUID = -5004578352105519960L;

		private DatePane() {
			this.initComponents();
		}

		/**
		 * 初始化
		 */
		private void initComponents() {
			this.setLayout(new FlowLayout(FlowLayout.LEFT));

			this.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4),
					BorderFactory.createTitledBorder("实现")));

			this.add(new JLabel(I18N.getLocText("daq.pane.startdate")));
			this.add(new DateSelect());
			this.add(new JLabel(I18N.getLocText("daq.pane.enddate")));
			this.add(new DateSelect());
			this.add(new JButton(I18N.getLocText("daq.pane.refresh")));
		}
	}
}
